home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
VISUALBA
/
FLDPAK.ZIP
/
FPDEMO2R.FRM
< prev
next >
Wrap
Text File
|
1994-02-02
|
15KB
|
501 lines
VERSION 2.00
Begin Form ReportFrm
BorderStyle = 3 'Fixed Double
Caption = "FieldPack demo program 2 -- Report Set-up"
ClientHeight = 2625
ClientLeft = 1215
ClientTop = 1890
ClientWidth = 7470
ControlBox = 0 'False
FontBold = -1 'True
FontItalic = 0 'False
FontName = "Symbol"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 3030
Left = 1155
LinkMode = 1 'Source
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2625
ScaleWidth = 7470
Top = 1545
Width = 7590
Begin CommandButton cmdPreview
Caption = "Preview"
Height = 315
Left = 6420
TabIndex = 16
Top = 900
Width = 855
End
Begin CommandButton cmdWider
Caption = "+"
Height = 315
Left = 4860
TabIndex = 11
Top = 1920
Width = 315
End
Begin CommandButton cmdNarrower
Caption = "-"
Height = 315
Left = 5220
TabIndex = 10
Top = 1920
Width = 315
End
Begin CommandButton cmdCancel
Caption = "Cancel"
Height = 315
Left = 6420
TabIndex = 5
Top = 1920
Width = 855
End
Begin CommandButton cmdPrint
Caption = "Print"
Height = 315
Left = 6420
TabIndex = 4
Top = 1410
Width = 855
End
Begin CommandButton cmdMoveDown
Caption = "Dn"
Height = 315
Left = 5700
TabIndex = 9
Top = 1170
Width = 375
End
Begin CommandButton cmdDeselectField
Caption = "<--"
Height = 315
Left = 2460
TabIndex = 3
Top = 1200
Width = 675
End
Begin CommandButton cmdSelectField
Caption = "-->"
Height = 315
Left = 2460
TabIndex = 2
Top = 720
Width = 675
End
Begin CommandButton cmdMoveUp
Caption = "Up"
Height = 315
Left = 5700
TabIndex = 8
Top = 750
Width = 375
End
Begin ListBox lstSelectedFields
Height = 1395
Left = 3360
TabIndex = 1
Top = 420
Width = 2175
End
Begin ListBox lstAvailableFields
Height = 1395
Left = 120
TabIndex = 0
Top = 420
Width = 2115
End
Begin Label lblTotalWidth
Alignment = 1 'Right Justify
Caption = "0"
Height = 195
Left = 4440
TabIndex = 15
Top = 2280
Width = 375
End
Begin Label lblFieldWidth
Alignment = 1 'Right Justify
Caption = "0"
Height = 195
Left = 4440
TabIndex = 14
Top = 1980
Width = 375
End
Begin Label Label4
Alignment = 1 'Right Justify
Caption = "Total width:"
Height = 195
Left = 3240
TabIndex = 13
Top = 2280
Width = 1155
End
Begin Label Label3
Alignment = 1 'Right Justify
Caption = "Field width:"
Height = 195
Left = 3240
TabIndex = 12
Top = 1980
Width = 1155
End
Begin Label Label2
Alignment = 2 'Center
Caption = "Selected for report:"
Height = 195
Left = 3360
TabIndex = 7
Top = 120
Width = 2145
End
Begin Label Label1
Alignment = 2 'Center
Caption = "Fields available:"
Height = 195
Left = 150
TabIndex = 6
Top = 120
Width = 2085
End
End
Option Explicit
Sub cmdCancel_Click ()
Unload ReportFrm
End Sub
Sub cmdDeselectField_Click ()
Dim i As Integer
Dim w As Integer
If lstSelectedFields.ListIndex <> -1 Then
lstAvailableFields.AddItem lstSelectedFields.Text
w% = Val(DS_GetField((lstSelectedFields.Text), FldDlm$, 3))
If lstAvailableFields.ListCount = 1 Then
lstAvailableFields.ListIndex = 0
End If
i% = lstSelectedFields.ListIndex
lstSelectedFields.RemoveItem lstSelectedFields.ListIndex
If lstSelectedFields.ListCount > 0 Then
If i% >= lstSelectedFields.ListCount Then
i% = lstSelectedFields.ListCount - 1
End If
lstSelectedFields.ListIndex = i%
lblTotalWidth.Caption = Format$(Val(lblTotalWidth.Caption) - w% - 1)
Else
lblFieldWidth.Caption = "0"
lblTotalWidth.Caption = "0"
End If
End If
End Sub
Sub cmdMoveDown_Click ()
Dim i As Integer
Dim temp As String
If lstSelectedFields.ListIndex <> -1 Then
If lstSelectedFields.ListIndex < lstSelectedFields.ListCount - 1 Then
i% = lstSelectedFields.ListIndex
temp$ = lstSelectedFields.List(i%)
lstSelectedFields.RemoveItem i%
lstSelectedFields.AddItem temp$, i% + 1
lstSelectedFields.ListIndex = i% + 1
End If
End If
End Sub
Sub cmdMoveUp_Click ()
Dim i As Integer
Dim temp As String
If lstSelectedFields.ListIndex <> -1 Then
If lstSelectedFields.ListIndex > 0 Then
i% = lstSelectedFields.ListIndex
temp$ = lstSelectedFields.List(i%)
lstSelectedFields.RemoveItem i%
lstSelectedFields.AddItem temp$, i% - 1
lstSelectedFields.ListIndex = i% - 1
End If
End If
End Sub
Sub cmdNarrower_Click ()
Dim w As Integer
If lstSelectedFields.ListCount > 0 Then
w% = Val(lblFieldWidth.Caption)
If w% > 0 Then
lblFieldWidth.Caption = Str$(w% - 1)
lblTotalWidth.Caption = Format$(Val(lblTotalWidth.Caption) - 1)
lstSelectedFields.List(lstSelectedFields.ListIndex) = DS_PutField((lstSelectedFields.List(lstSelectedFields.ListIndex)), FldDlm$, 3, (lblFieldWidth.Caption))
End If
End If
End Sub
Sub cmdPreview_Click ()
Dim i As Integer
Dim t As String
If lstSelectedFields.ListCount > 0 Then
pr_num_fields% = lstSelectedFields.ListCount
ReDim pr_fld_numbers(pr_num_fields% + 1)
ReDim pr_fld_widths(pr_num_fields% + 1)
For i% = 1 To pr_num_fields%
t$ = lstSelectedFields.List(i% - 1)
t$ = DS_ReplaceDlms(t$, String$(40, " "), "") ' trim ???
pr_fld_numbers(i%) = Val(DS_GetField(t$, FldDlm$, 2))
pr_fld_widths(i%) = Val(DS_GetField(t$, FldDlm$, 3))
Next i%
End If
preview_report
End Sub
Sub cmdPrint_Click ()
Dim i As Integer
Dim t As String
If lstSelectedFields.ListCount > 0 Then
pr_num_fields% = lstSelectedFields.ListCount